package com.ruoyi.system.domain.dao;

import com.baomidou.mybatisplus.annotation.*;
import com.eic.framework.core.annotation.InsertTime;
import com.eic.framework.core.annotation.InsertUser;
import com.eic.framework.core.annotation.UpdateTime;
import com.eic.framework.core.annotation.UpdateUser;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;
import com.ruoyi.common.annotation.Excel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;

import java.io.Serializable;
import java.util.Date;

/**
 * 角色信息对象 sys_role
 *
 * @author 尹国春
 * @date 2022-07-14
 */
@ApiModel("角色信息对象")
@TableName("sys_role")
public class SysRole implements Serializable
{
    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "ID")
    @TableId(value = "role_id",type = IdType.INPUT)
    private String roleId;

    /** 角色名称 */
    @ApiModelProperty(value = "角色名称")
    @Excel(name = "角色名称")
    @TableField("role_name")
    private String roleName;

    /** 角色权限字符串 */
    @ApiModelProperty(value = "角色权限字符串")
    @Excel(name = "角色权限字符串")
    @TableField("role_key")
    private String roleKey;

    /** 显示顺序 */
    @ApiModelProperty(value = "显示顺序")
    @Excel(name = "显示顺序")
    @TableField("role_sort")
    private Long roleSort;

    /** 帐号状态（0正常 1停用） */
    @ApiModelProperty(value = "帐号状态（0正常 1停用）")
    @TableField("status")
    private String status;

    /** 删除标志（0代表存在 2代表删除） */
    @ApiModelProperty(value = "删除标志（0代表存在 2代表删除）")
    @TableField("del_flag")
    @JsonIgnore
    @TableLogic
    private String delFlag;

    /** 创建者 */
    @ApiModelProperty(value = "创建者")
    @TableField("create_by")
    @InsertUser
    private String createBy;

    /** 创建时间 */
    @ApiModelProperty(value = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField("create_time")
    @InsertTime
    private Date createTime;

    /** 更新者 */
    @ApiModelProperty(value = "更新者")
    @TableField("update_by")
    @UpdateUser
    private String updateBy;

    /** 更新时间 */
    @ApiModelProperty(value = "更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField("update_time")
    @UpdateTime
    private Date updateTime;

    /** 备注 */
    @ApiModelProperty(value = "备注")
    @Excel(name = "备注")
    @TableField("remark")
    private String remark;

    public SysRole setRoleId(String roleId)
    {
        this.roleId = roleId;
        return this;
    }

    public String getRoleId()
    {
        return roleId;
    }
    public SysRole setRoleName(String roleName)
    {
        this.roleName = roleName;
        return this;
    }

    public String getRoleName()
    {
        return roleName;
    }
    public SysRole setRoleKey(String roleKey)
    {
        this.roleKey = roleKey;
        return this;
    }

    public String getRoleKey()
    {
        return roleKey;
    }
    public SysRole setRoleSort(Long roleSort)
    {
        this.roleSort = roleSort;
        return this;
    }

    public Long getRoleSort()
    {
        return roleSort;
    }
    public SysRole setStatus(String status)
    {
        this.status = status;
        return this;
    }

    public String getStatus()
    {
        return status;
    }
    public SysRole setDelFlag(String delFlag)
    {
        this.delFlag = delFlag;
        return this;
    }

    public String getDelFlag()
    {
        return delFlag;
    }
    public SysRole setCreateBy(String createBy)
    {
        this.createBy = createBy;
        return this;
    }

    public String getCreateBy()
    {
        return createBy;
    }
    public SysRole setCreateTime(Date createTime)
    {
        this.createTime = createTime;
        return this;
    }

    public Date getCreateTime()
    {
        return createTime;
    }
    public SysRole setUpdateBy(String updateBy)
    {
        this.updateBy = updateBy;
        return this;
    }

    public String getUpdateBy()
    {
        return updateBy;
    }
    public SysRole setUpdateTime(Date updateTime)
    {
        this.updateTime = updateTime;
        return this;
    }

    public Date getUpdateTime()
    {
        return updateTime;
    }
    public SysRole setRemark(String remark)
    {
        this.remark = remark;
        return this;
    }

    public String getRemark()
    {
        return remark;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.SHORT_PREFIX_STYLE)
                .append("roleId", getRoleId())
                .append("roleName", getRoleName())
                .append("roleKey", getRoleKey())
                .append("roleSort", getRoleSort())
                .append("status", getStatus())
                .append("delFlag", getDelFlag())
                .append("createBy", getCreateBy())
                .append("createTime", getCreateTime())
                .append("updateBy", getUpdateBy())
                .append("updateTime", getUpdateTime())
                .append("remark", getRemark())
                .toString();
    }
}

